package sort;

public class BubbleSort {
 static void bubble(int[] massive) {
      int temp = 0;
      for (int i = 0; i< massive.length; i++) {
    	  for (int j = 0; j < i; j++) {
    		if (massive[j] > massive[j+1]){
    			temp = massive[j];
    			massive[j] = massive[j+1];
    			massive[j+1] = temp;
    	
    			}
    		}
    	  }
      }
 private static void print (int[] massiv) {

System.out.println( );

     for (int i = 0; i < massiv.length; i++)
         System.out.print(" " + massiv[i]);
     System.out.println();
     
 }	  
    			 
               

	public static void main(String[] args) {
	int[] massive = new int[5];
	massive[0] = 9;
	massive[1] = 2;
	massive[2] = 5;
	massive[3] = 63;
	massive[4] = 22;
	
	for (int i=0;i<5;i++)
	BubbleSort.bubble(massive);
	BubbleSort.print(massive);
}

}
